<?php

/**
 * DatacenterController
 * 
 * @package Sgit 
 * @author Juan Manuel Martinez Carrillo
 * @copyright Juan Manuel Martinez Carrillo
 * @version 2012
 * @access public
 */

class DatacenterController extends Sgit_Controller_Action
{

    protected $_main_model = 'Datacenter';
    protected $_main_form = 'Datacenter';


    public function indexAction()
    {
        $rows = $this->_model->default->getAll();
        $this->view->rows = $this->_prepareRowsToTr($rows);
    }

    public function editarAction()
    {
        $this->_editar();
    }


    public function insertarAction()
    {
        $this->_insertar();
    }

    public function borrarAction()
    {
        $this->_borrar();
    }


    protected function _prepareValuesToTr($row)
    {
        $row['dc'] = $row['dc'] ? 'SI' : 'NO';
        $row['co'] = $row['co'] ? 'SI' : 'NO';
        $row['ct'] = $row['ct'] ? 'SI' : 'NO';

        return $row;
    }


}
